import lang from '@/lang';

const e = {
  axisPointer: {
    show: true,
    crossStyle: 'dashed',
    snap: true,
    lineStyle: {
      type: 'dashed',
    },
    label: {
      backgroundColor: 'rgba(50,50,50,0.7)',
    },
  },
  tooltip: {
    trigger: 'axis',
  },
  grid: {
    left: 72,
    top: 60,
    right: 72,
    bottom: 60,
  },
  legend: {
    data: [lang.t('dashboard.rate'), lang.t('dashboard.hash_rate')],
    top: '5%',
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: [],
    axisLine: {
      lineStyle: {
        color: '#eaeaea', // '#c0a465'
      },
    },
    nameTextStyle: {
      color: '#333', // '#c0a465'
    },
    axisTick: {
      show: false,
    },
    axisLabel: {
      fontSize: 12,
      color: '#333', // '#c0a465'
    },
    splitLine: {
      show: false,
    },
  },
  yAxis: [
    {
      type: 'value',
      name: lang.t('dashboard.rate'),
      axisLine: {
        show: false,
      },
      nameTextStyle: {
        color: '#333', // '#c0a465'
      },
      axisTick: {
        show: false,
      },
      axisLabel: {
        fontSize: 12,
        color: '#333', // '#c0a465'
      },
      splitLine: {
        show: false,
      },
    },
  ],
  series: [
    {
      data: [],
      type: 'line',
      name: lang.t('dashboard.rate'),
      showSymbol: true,
      symbol: 'emptyDiamond',
      symbolSize: 4,
      showAllSymbol: true,
      itemStyle: {
        normal: {
          color: '#70c1b3',
          borderWidth: 1,
        },
      },
      lineStyle: {
        width: 2,
      },
      smooth: true,
    },
    {
      data: [],
      type: 'line',
      name: lang.t('dashboard.hash_rate'),
      showSymbol: false,
      symbol: 'emptyDiamond',
      symbolSize: 4,
      itemStyle: {
        normal: {
          color: '#ccc',
          borderWidth: 1,
        },
      },
      lineStyle: {
        width: 2,
      },
      smooth: true,
    },

  ],
};

const innovateSuanLiEchartsOption = JSON.parse(JSON.stringify(e));
const suanLiEchartsOption = JSON.parse(JSON.stringify(e));
suanLiEchartsOption.legend.data.push(lang.t('dashboard.refuse_rate'));
suanLiEchartsOption.yAxis.push({
  type: 'value',
  name: lang.t('dashboard.refuse_rate'),
  max: 10,
  min: 0,
  interval: 2,
  axisLine: {
    show: false,
  },
  nameTextStyle: {
    color: '#333', // '#c0a465'
  },
  axisTick: {
    show: false,
  },
  axisLabel: {
    fontSize: 12,
    color: '#333', // '#c0a465'
  },
  splitLine: {
    show: false,
  },
});
suanLiEchartsOption.series.push({
  data: [],
  type: 'line',
  name: lang.t('dashboard.refuse_rate'),
  showSymbol: true,
  symbol: 'emptyDiamond',
  symbolSize: 4,
  showAllSymbol: true,
  itemStyle: {
    normal: {
      color: '#eb547c',
      borderWidth: 1,
    },
  },
  lineStyle: {
    width: 2,
  },
  yAxisIndex: 1,
  smooth: true,
});
// full
const suanLiFullEchartsOption = JSON.parse(JSON.stringify(suanLiEchartsOption));
suanLiFullEchartsOption.tooltip.backgroundColor = 'rgba(0,0,0,0.7)';
suanLiFullEchartsOption.legend.textStyle = { color: '#c0a465' };
suanLiFullEchartsOption.xAxis.axisLine.lineStyle.color = '#c0a465';
suanLiFullEchartsOption.xAxis.nameTextStyle.color = '#c0a465';
suanLiFullEchartsOption.xAxis.axisLabel.color = '#c0a465';
suanLiFullEchartsOption.yAxis[0].nameTextStyle.color = '#c0a465';
suanLiFullEchartsOption.yAxis[0].axisLabel.color = '#c0a465';
suanLiFullEchartsOption.yAxis[1].nameTextStyle.color = '#c0a465';
suanLiFullEchartsOption.yAxis[1].axisLabel.color = '#c0a465';

export {
  innovateSuanLiEchartsOption,
  suanLiEchartsOption,
  suanLiFullEchartsOption,
};
